@layout("/common/_curd/_container.html"){

<script type="text/javascript">
	var ctx = "${basePath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	
	$(function(){
		initGrid();
		initMenuBtn("btns", "${code}");
	});
	
	function initGrid(){
		var grid_url = ctx + "/${code}/graduate_list";
        var _colnames = ["ID",
            "班级名称",
            "班级名称",
            "年级",
            "毕业年份",
            "班主任",
            "班主任",
            "课任老师",
            "课任老师",
            "学生人数",
            "操作"];
        var _colmodel = [{name:"id", index:"id",hidden:true},
            {name:"full_class_name", index:"full_class_name", width:50},
            {name:"class_name", index:"class_name", width:50},
            {name:"dict_grade_id", index:"grade_id", width:50},
            {name:"graduate_year", index:"graduate_year", width:50},
            {name:"head_teacher", index:"head_teacher",hidden:true},
            {name:"head_teacher_name", index:"head_teacher_name", width:100},
            {name:"teachers", index:"teachers",hidden:true},
            {name:"subject_teacher_names", index:"teachers", width:100},
            {name:"stu_count", index:"stu_count", width:100},
            {name: 'id',formatter:fmatterOperation, width:200,sortable:false}
        ];
		
		jQuery(grid_selector).jqGrid({
			url : grid_url,
		    shrinkToFit : true,
			colNames : _colnames,
			colModel : _colmodel, 
			jsonReader : {id :"id"},
			pager : pager_selector,
			postData : {sort : "id", order : "desc"}
		});
	}
    function fmatterOperation(cellvalue, options, rowObject){
        return '<button class="btn btn-primary btn-sm" onclick="view('+cellvalue+',\''+rowObject.full_class_name+'\')">查看名单</button>';
    }
    function view(id,year){
        var iframe_width=window.top.$(window).width();
        var iframe_height=window.top.$(window).height();
        var index=layer.open({
            type: 2,
            title:"毕业班级→"+year+"学生及家长名单",
            area: [iframe_width+"px",iframe_height+"px"],
            fix: true, //不固定
            maxmin: false,
            content: ctx + "/${code}/graduate_detail/"+id
        });
        layer.full(index);
    }

</script>

    <div class="row">
        <div class="col-xs-12">
            <div class="row-fluid" style="margin-bottom: 5px;">
                <div class="tabbable">
                    <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab4">
                        <li>
                            <a data-toggle="tab" href="#" onclick="javascript:window.location.href='${basePath}/${code}'" aria-expanded="true">在校班级</a>
                        </li>
                        <li class="active">
                            <a data-toggle="tab" href="#" onclick="javascript:window.location.href='${basePath}/${code}/graduate'" aria-expanded="true">毕业班级</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
	<!-- 配置 grid -->
	<div class="row">
		<div class="col-xs-12 tb-grid">
			<!-- 配置 查询 -->
			@ var _col=[
			@		{name:"班级名称", index:"class_name", type:"text"},
			@		{name:"毕业年份", index:"graduate_year", type:"text"}
			@];
			@ include("/common/_function/_search2.html",{"col":_col}){}
			<!-- 按钮 -->
<!--
			<div class="welljq well-sm" id="btns"></div>
-->
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页-->
			<div id="grid-pager"></div>
		</div>
	</div>
	
	<!-- 引入所需的js -->
	@include("/common/_listscript.html"){}
	
@}	